package com;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import javax.faces.model.SelectItem;

public class DropDownValues {
	public String selectedClassName;
	public List<SelectItem> listOfFiles;
	
	public String getSelectedClassName() {
		return selectedClassName;
	}
	public void setSelectedClassName(String selectedClassName) {
		this.selectedClassName = selectedClassName;
	}
	public List<SelectItem> getListOfFiles() {
		listOfFiles = new ArrayList<SelectItem>();
		/*listOfFiles.add(new SelectItem("suneel1"));
		listOfFiles.add(new SelectItem("suneel2"));
		listOfFiles.add(new SelectItem("suneel3"));
		listOfFiles.add(new SelectItem("suneel4"));
		listOfFiles.add(new SelectItem("suneel5"));*/
		
		System.out.println("with in the get List");
		File sourceDir = new File("D:/softwares/eclipse-jee-indigo-win32/eclipse/createdJavaFiles");
		if(sourceDir.isDirectory()){
			File fileName[] = sourceDir.listFiles(new FileNameFilterExt("java")); 
				
				for(int i=0;i<fileName.length;i++){
					System.out.println(fileName[i]);
					listOfFiles.add(new SelectItem(fileName[i].getAbsolutePath(),fileName[i].getName()));
				}	
					
		}
		return listOfFiles;
	}
	public void setListOfFiles(List<SelectItem> listOfFiles) {
		this.listOfFiles = listOfFiles;
	}
	
}
